home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / music / bbsamt42.zip / BANSI003.DOC next >
Text File  |  1994-10-04  |  28KB  |  756 lines

  1. copyright (c) 1994 by Paul Wheaton, Banana Programming
  2.  
  3. The ANSI-BBS industry is riddled with conflicts.  Since the true ANSI
  4. standard has not been strictly followed, a variety of variations have
  5. evolved.  Some have become popular.
  6.  
  7. This document spells out what BananaCom uses for it's terminal emulation: A
  8. mish-mash of ANSI, VT100, pseudo-ANSI and pseudo-VT100 that tries to follow
  9. what most modem services expect and use. Perhaps this will help to make
  10. BBS's and COM programs work together with a little less research and
  11. programming effort.
  12.  
  13. Note that some features of BananaCom are intentionally undocumented.  This
  14. has mostly to do with VT100 stuff which is well documented in other places
  15. AND, I think, the use of which should be discouraged.
  16.  
  17. Terminal sends:
  18.  
  19.   All ASCII characters from 1 to 127 are sent as is.  If somebody wants to
  20.   feed a special character that comes through as a character 128 through
  21.   255, send that through too.
  22.  
  23.   Note that "Doorway mode" is a simple, beautiful thing developed by
  24.   Marshall Dudley that allows a user calling a modem service to run DOS
  25.   programs on the modem service! Look for DRWY*.* on your favorite modem
  26.   service or call Marshall Dudley's support BBS at (615)675-3282.  While
  27.   BananaCom is in Doorway Mode, all IBM PC extended keys send a NULL
  28.   character (ASCII value 0) followed by the scan code given by the BIOS.
  29.  
  30.   The following keystrokes are well established:
  31.  
  32.         Keystroke             Sent          Doorway mode
  33.  
  34.         left arrow key        ESC [ D         NULL 75
  35.         right arrow key       ESC [ C         NULL 77
  36.         up arrow key          ESC [ A         NULL 72
  37.         down arrow key        ESC [ B         NULL 80
  38.         home key              ESC [ H         NULL 71
  39.         end key               ESC [ K         NULL 79
  40.         ^home key             ESC [ L         NULL 119
  41.         ^page up              ESC [ M         NULL 132
  42.  
  43.         F1 key                ESC O P         NULL 59
  44.         F2 key                ESC O Q         NULL 60
  45.         F3 key                ESC O w         NULL 61
  46.         F4 key                ESC O x         NULL 62
  47.  
  48.           capital "oh", not a zero^            ^ASCII value 0
  49.  
  50.   All other keys send a NULL character (ASCII value 0) and then the BIOS
  51.   scan code (as a character, not multi digits representing the number).
  52.   Note that most com programs will use Alt-A through Alt-Z and Alt-1
  53.   through Alt-9 and Alt-0.  If there happens to be keys left they will be
  54.   passed through.
  55.  
  56.   Function keys are your best bet and are all passed through
  57.  
  58.                Alone        Shift         Ctrl         Alt
  59.  
  60.         F1                 NULL  84     NULL  94     NULL 104
  61.         F2                 NULL  85     NULL  95     NULL 105
  62.         F3                 NULL  86     NULL  96     NULL 106
  63.         F4                 NULL  87     NULL  97     NULL 107
  64.         F5    NULL  63     NULL  88     NULL  98     NULL 108
  65.         F6    NULL  64     NULL  89     NULL  99     NULL 109
  66.         F7    NULL  65     NULL  90     NULL 100     NULL 110
  67.         F8    NULL  66     NULL  91     NULL 101     NULL 111
  68.         F9    NULL  67     NULL  92     NULL 102     NULL 112
  69.         F10   NULL  68     NULL  93     NULL 103     NULL 113
  70.  
  71.    Some com programs use the Page Up and Page Down keys to initiate a file
  72.    transfer although this seems to be changing - these keys are of great
  73.    use to BBS's.
  74.  
  75.         Page Up           NULL  73
  76.         Page Down         NULL  81
  77.         Insert            NULL  82
  78.  
  79.    Note that when you press control-page-down with some terminal programs,
  80.    they send   ESC [ H ESC [ 2 J   and a lot of BBS's simply ignore that.
  81.  
  82.         ctrl-page-down    NULL 118
  83.         ctrl-end          NULL 117
  84.         ctrl-left-arrow   NULL 115
  85.         ctrl-right-arrow  NULL 116
  86.         shift-tab         NULL 15
  87.  
  88. Terminal receives:
  89.  
  90.   Most ANSI terminals use a screen 80x24 - with the last line reserved for
  91.   reporting the current status of the terminal program.  BananaCom uses
  92.   this standard.
  93.  
  94.   There are a few ASCII characters that have a special effect on the
  95.   terminal:
  96.  
  97.       Dec  Hex  char   function
  98.  
  99.        7    7    ^G    beep
  100.        8    8    ^H    destructive backspace
  101.        9    9    ^I    tab - move to next tab column (8,16,24,32,40...)
  102.       10    A    ^J    line feed - move down one. Scroll up if needed
  103.       12    C    ^L    clear screen & home cursor (1,1)
  104.       13    D    ^M    return - move cursor to column 1
  105.  
  106.   Note that there is some controversy in the ANSI vs. VT100 worlds about
  107.   what color (attribute) to use when clearing the screen.  From what I
  108.   could find out, this is the result of "might makes right" introduced by
  109.   DOS version 3.x.  Before DOS 3.x, clear the screen was always "clear to
  110.   black".  DOS 3 used "clear to current attribute background color" - this
  111.   introduced conflict.  Now, some programs clear to black and some clear to
  112.   the current attribute.  The safest thing to do, of course, is to set your
  113.   background attribute to black before you clear.  Earlier versions of
  114.   BananaCom would clear to black, newer versions clear to current attribute
  115.   - don't count on this staying this way.  HOWEVER!  You can count on the
  116.   "ESC [ b" functions that allow you to color a region, including the whole
  117.   screen!  See below for more details.
  118.  
  119.   Note also that in Doorway mode passing through a NULL (ASCII value 0), will
  120.   force the next character to be displayed on the screen and not
  121.   interpretted.
  122.  
  123.   Example:
  124.  
  125.     Sending a ^L that is not preceeded by a NULL character will result in
  126.     clearing the screen.  Sending a NULL character and then ^L while in
  127.     doorway mode will result in the female symbol appearing at the current
  128.     cursor location.
  129.  
  130.  
  131.   Escape sequences do not have spaces in them.  Spaces have been added
  132.   here for readability.
  133.  
  134.   Anything appearing in angle brackets is an escape sequnce variable.  The
  135.   angle brackets are not sent.
  136.  
  137.  
  138.   ESC D    scroll up
  139.   ~~~~~~~~~~~~~~~~~~
  140.     All of the text on the screen (or the scrolling region, if one is
  141.     defined) is scrolled up one line.  The bottom line is filled with
  142.     spaces colored according to the current attribute.
  143.  
  144.     Note that there is no left bracket "[" between the ESC and the 'D'.
  145.  
  146.     Example:  ESC D              scroll all text up one line
  147.  
  148.  
  149.   ESC M    scroll down
  150.   ~~~~~~~~~~~~~~~~~~~~
  151.     All of the text on the screen (or the scrolling region, if one is
  152.     defined) is scrolled down one line.  The top line is filled with spaces
  153.     colored according to the current attribute.
  154.  
  155.     Note that there is no left bracket "[" between the ESC and the 'M'.
  156.  
  157.     Example:  ESC M              scroll all text down one line
  158.  
  159.  
  160.   ESC c    reset terminal
  161.   ~~~~~~~~~~~~~~~~~~~~~~~
  162.     This is something of particular use to door programs and internet
  163.     service providers.  Sometimes, a user will go into a door or telnet to
  164.     an internet service and they will set a variety of bizarre terminal
  165.     modes that BananaCom (and other COM programs) will retain until told to
  166.     drop them.  If you send this sequence, you can know for certain that
  167.     you have the defaults and a clean slate.  I strongly recommend that
  168.     modem services, door programs and any on-line utilities use this often.
  169.     Especially if your service is offered on the internet.
  170.  
  171.  
  172.   ESC [ @    insert char
  173.   ~~~~~~~~~~~~~~~~~~~~~~
  174.     Insert a space into the current line at the current cursor position.
  175.     The character at column 80 is thrown out.  The current attribute is
  176.     used for the new space.
  177.  
  178.  
  179.   ESC [ <NumLines> A    cursor up
  180.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181.     Move the cursor up specified number of lines (default is one).
  182.  
  183.     If "ESC [ ? 6 h" has been received since last "ESC [ <var> ; <var> r"
  184.     then the cursor will not be allowed to move beyond the top of the
  185.     scrolling region.
  186.  
  187.     Example:  ESC [ 1 0 A        move up ten lines
  188.  
  189.     Example:  ESC [ A            move up one line
  190.  
  191.  
  192.   ESC [ <NumLines> B    cursor down
  193.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  194.     Move the cursor down specified number of lines (default is one).
  195.  
  196.     If "ESC [ ? 6 h" has been received since last "ESC [ <var> ; <var> r"
  197.     then the cursor will not be allowed to move beyond the bottom of the
  198.     scrolling region.
  199.  
  200.     Example:  ESC [ 1 0 B        move down ten lines
  201.  
  202.     Example:  ESC [ B            move down one line
  203.  
  204.  
  205.   ESC [ <NumCols> C    cursor right
  206.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  207.     Move the cursor right specified number of lines (default is one).
  208.  
  209.     Example:  ESC [ 1 0 C        move right ten columns
  210.  
  211.     Example:  ESC [ C            move right one column
  212.  
  213.  
  214.   ESC [ <NumCols> D    cursor left
  215.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  216.     Move the cursor left specified number of lines (default is one).  Cannot
  217.     move beyond left of screen.
  218.  
  219.     Example:  ESC [ 1 0 D        move left ten columns
  220.  
  221.     Example:  ESC [ D            move left one column
  222.  
  223.  
  224.   ESC [ <Num> E    line feed
  225.   ~~~~~~~~~~~~~~~~~~~~~~~~~~
  226.     Convert to specified number of line feeds.  If the cursor is at the
  227.     bottom of the screen (or scrolling region if one is defined) text will
  228.     be scrolled up and the bottom line will be cleared.
  229.  
  230.     Example:  ESC [ 1 0 E        convert and process as ten linefeeds
  231.  
  232.     Example:  ESC [ E            convert and process as onr linefeed
  233.                                  (why not just send ^J ?)
  234.  
  235.  
  236.   ESC [ F    undefined
  237.   ESC [ G    undefined
  238.  
  239.  
  240.   ESC [ <row> ; <col> H    move to
  241.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  242.     Move cursor to this position.
  243.  
  244.     If "ESC [ ? 6 h" has been received since the last
  245.     "ESC [ <var> ; <var> r" then the cursor will be positioned relative to
  246.     the scrolling region.
  247.  
  248.     This will perform exactly the same as "ESC [ <row> ; <col> f".
  249.  
  250.     Example:  ESC [ 1 0 ; 5 H    The cursor will be positioned at row 10
  251.                                  and column 5.
  252.  
  253.     Example:  ESC [ 10 H         The cursor will be positioned at row 10
  254.                                  and column 1.
  255.  
  256.     Example:  ESC [ H            The cursor will be positioned at row 1
  257.                                  and column 1.
  258.  
  259.  
  260.   ESC [ I    undefined
  261.  
  262.  
  263.   ESC [ <type> J    clear all or part of display
  264.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265.     Clear all or part of the screen (or scrolling region if one is
  266.     defined).
  267.  
  268.     The cleared region will always be the "current attribute", although
  269.     this could later change to "clear to black" due to some standards
  270.     issues.
  271.  
  272.     Cursor does not move.
  273.  
  274.     Example:  ESC [ 0 J          Clear from cursor to end of screen
  275.  
  276.     Example:  ESC [ 1 J          Clear from beginning of screen to cursor
  277.  
  278.     Example:  ESC [ 2 J          Clear whole screen
  279.                                  (note that sending ^L does the same thing)
  280.  
  281.     Example:  ESC [ J            same as "ESC [ 0 J"
  282.  
  283.  
  284.   ESC [ <type> K    clear all or part of current line
  285.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  286.     The cleared region will always be the "current attribute" although
  287.     this could later change to "clear to black" due to some standards
  288.     issues.
  289.  
  290.     Cursor does not move.
  291.  
  292.     Example:  ESC [ 0 K          Clear from cursor to end of line
  293.  
  294.     Example:  ESC [ 1 K          Clear from beginning of line to cursor
  295.  
  296.     Example:  ESC [ 2 K          Clear whole line
  297.  
  298.     Example:  ESC [ K            same as "ESC [ 0 K"
  299.  
  300.  
  301.   ESC [ <num> L    insert line
  302.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  303.     "<num>" blank lines will be inserted at the current cursor location.
  304.     These lines will have the color of the current attribute.  The previous
  305.     current line and all of the lines below will be moved down.  Lines that
  306.     are scrolled beyond the bottom of the screen (or scrolling region, if
  307.     one is defined) will be lost.
  308.  
  309.     Example:  ESC [ 1 0 K        insert ten lines
  310.  
  311.     Example:  ESC [ K            insert one line
  312.  
  313.  
  314.   ESC [ M    ANSI Music / delete line
  315.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  316.     This is the biggest conflict in ANSI emulation.  The actual ANSI
  317.     standard clearly states that this sequence is to be used for "delete
  318.     line".  The person that came up with "ANSI music" must not have known
  319.     this.  There are still many modem services and mainframe computers that
  320.     depend on this being "delete line" - however, far more people are
  321.     served by systems that depend on this being "ANSI music".
  322.  
  323.     What this means is that as a programmer, you cannot depend on ESC [ M.
  324.     Some modem services and com programs will lock up when they expect one
  325.     thing and receive another.
  326.  
  327.     Here is a solution:
  328.  
  329.         a)  A modem service can send "ESC [ b" to the terminal.  If the
  330.         emulation outlined in this document is supported, 003 will be sent
  331.         back.  If it is not, the terminal will most likely not show the
  332.         escape sequence and you can then know that ESC [ M should be
  333.         avoided since its interpretation is unknown and could cause a
  334.         lockup.
  335.  
  336.         b)  Use "ESC [ N" for music and "ESC [ Y" for delete line.
  337.  
  338.     What BananaCom supports for ESC [ M may change although at the time of
  339.     this writing, it is used for ANSI music.  See "ESC [ N" and "ESC [ Y"
  340.     for information on how to use ANSI music and delete line.
  341.  
  342.  
  343.   ESC [ N <music codes> <^N>  ANSI music
  344.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  345.     This command is provided with BananaCom as a substitute to the
  346.     traditional ANSI music sequence of "ESC [ M" since that sequence has
  347.     conflicts.
  348.  
  349.     For complete information on how to use ANSI music, look for the file
  350.     BBSAMT*.* (BBS ANSI Music Tutor) by Linda Bloom.  This file is
  351.     available on the Montana Banana BBS (406)543-8234 and Bloomunit BBS
  352.     (407)687-8712.
  353.  
  354.     Example:  ESC [ N E 8 G 8 G 8 G 8 F 4 E 8 G 2 ^N    this will belt out
  355.     the first few notes of "Popeye the Sailor".  "ESC [ N" starts the music
  356.     sequence and the control-N character finishes.  What's in between are
  357.     all of the notes and how long each note lasts.  Further details of the
  358.     music may be provided as specified in BBSAMT.
  359.  
  360.     Note that this is not an ANSI or VT100 standard, but something that is
  361.     in BananaCom.  I hope other com program folks do the same.
  362.  
  363.  
  364.   ESC [ O    undefined
  365.  
  366.  
  367.   ESC [ <num> P    delete char
  368.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  369.     Delete the character at the current cursor position.  All characters to
  370.     the right of the cursor will be shifted one to the left.  The right
  371.     most character on the screen will be converted to a space and will have
  372.     the same attribute as the character that used to be there.
  373.  
  374.     Example:  ESC [ 1 0 P        delete ten characters
  375.  
  376.     Example:  ESC [ P            delete one character
  377.  
  378.  
  379.   ESC [ Q    undefined
  380.   ESC [ R    undefined
  381.  
  382.  
  383.   ESC [ S    scroll up
  384.   ~~~~~~~~~~~~~~~~~~~~
  385.     see ESC D
  386.  
  387.  
  388.   ESC [ T    scroll down
  389.   ~~~~~~~~~~~~~~~~~~~~~~
  390.     see ESC M
  391.  
  392.  
  393.   ESC [ U    clear
  394.   ~~~~~~~~~~~~~~~~
  395.     Clear the screen with the "normal" attribute and home the cursor.
  396.     New text will use the previously defined attribute.
  397.  
  398.     Note that this does the exact same thing as ^L.
  399.  
  400.  
  401.   ESC [ V    undefined
  402.   ESC [ W    undefined
  403.   ESC [ X    undefined
  404.  
  405.  
  406.   ESC [ <num> Y    delete line
  407.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  408.     This command is provided with BananaCom as a substitute to the
  409.     traditional delete line sequence of "ESC [ M" since that sequence has
  410.     conflicts.
  411.  
  412.     "<num>" lines will be deleted at the current cursor location.
  413.     Lines from below will be scrolled up.  The blank lines inserted at the
  414.     bottom of the screen (or scrolling region, if one is defined) will be
  415.     colored with the current attribute.
  416.  
  417.     Example:  ESC [ 1 0 Y        delete ten lines
  418.  
  419.     Example:  ESC [ Y            delete one line
  420.  
  421.     Note that this is not an ANSI standard, but something that is in
  422.     BananaCom.  I hope other COM program folks do the same.
  423.  
  424.  
  425.   ESC [ Z    back tab
  426.   ~~~~~~~~~~~~~~~~~~~
  427.     Relocate the cursor to the previous tab.  Tabs are located at columns
  428.     1, 8, 16, 24, 32, 40, 48, 56, 64, 72 and 80.  So, if your cursor is
  429.     currently located at column 10 and a "ESC [ Z" is received, the cursor
  430.     will be moved to column 8.
  431.  
  432.  
  433.   ESC [ a    undefined
  434.  
  435.  
  436.   ESC [ b    Banana ANSI
  437.   ~~~~~~~~~~~~~~~~~~~~~~
  438.     There are five different functions that can be accessed through this
  439.     sequence.
  440.  
  441.     ESC [ 0 b
  442.     ESC [ b
  443.  
  444.       Banana ANSI query. If a terminal uses everything listed in this
  445.       document, it will send back
  446.  
  447.             003
  448.  
  449.       later versions may return  004  or  005  or  006   etc.
  450.  
  451.     ESC [ 1 <Row> ; <Col> ; <Wide> ; <High> ; <Att> b
  452.  
  453.       Color box.  All parameters are optional.  Relative to the scrolling
  454.       region if one is defined.  "ESC [ 1 b" would color the entire screen
  455.       (or scrolling region, if one is defined) to the current attribute.
  456.  
  457.       Note that the default for "High" is 24 or the height of the scrolling
  458.       region if one is defined.
  459.  
  460.       Note that "Att" is a number that represents PC text video attributes.
  461.  
  462.       Examples:
  463.  
  464.         ESC [ 5 ; 3 0 ; 2 0 ; 1 0 ; 1 6 b
  465.  
  466.           This would put a blue box on the screen 20 columns wide and 10
  467.           lines high with the upper left corner being in position row 5 and
  468.           column 30.
  469.  
  470.         ESC [ 5 ; 3 0 b
  471.  
  472.           This puts a box on the screen colored with the current attribute.
  473.           The upper left corner is in row 5, column 30 and the lower right
  474.           corner of the box is in the bottom of the screen (or scrolling
  475.           region if one is defined) and column 80.
  476.  
  477.     ESC [ 2 <Row> ; <Col> ; <Wide> ; <High> ; <Att> b
  478.  
  479.       Draw box.  Similar to "ESC [ 1 b" except that a single line box is
  480.       drawn.
  481.  
  482.     ESC [ 3 b
  483.  
  484.       Preserve the screen.  The entire screen (except for the status line
  485.       at the bottom) is saved.
  486.  
  487.     ESC [ 4 b
  488.  
  489.       Restore a preserved screen.  Whatever the screen looked like before
  490.       the last "ESC [ 3 b", is how it will look after this escape sequence.
  491.  
  492.       Note that things like cursor location and current attribute are not
  493.       saved.
  494.  
  495.     Note that these sequnces are not an ANSI standard, but something that
  496.     is in BananaCom.  I hope other com program folks do the same.
  497.  
  498.  
  499.   ESC [ c    VT100 query response
  500.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  501.     Some modem services use mainframe computers that send this and are
  502.     looking for some unique response or they will assume your terminal is
  503.     brain dead.  BananaCom sends back "ESC [ ? 1 ; 2 c" and that seems to
  504.     keep most machines happy.
  505.  
  506.  
  507.   ESC [ d    undefined
  508.   ESC [ e    undefined
  509.  
  510.   ESC [ f    move to
  511.   ~~~~~~~~~~~~~~~~~~
  512.     see "ESC [ H"
  513.  
  514.  
  515.   ESC [ g    not used - VT100 tabs
  516.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  517.     not supported in BananaCom
  518.  
  519.  
  520.   ESC [ h    set options
  521.   ~~~~~~~~~~~~~~~~~~~~~~
  522.     These options include sending an actual question mark or equals sign as
  523.     part of the sequence:
  524.  
  525.        ESC [ ? 6 h      certain functions which normally ignore the
  526.                         scrolling region, will now operate relative to the
  527.                         scrolling region.  Note that those functions will
  528.                         again ignore the scrolling region the next time the
  529.                         scrolling region is changed.
  530.  
  531.        ESC [ ? 7 h      Auto word wrap is turned on (it is normally on -
  532.                         this is provided in case you turn it off).
  533.  
  534.        ESC [ = 2 5 5 h  doorway mode on (default is off).  This makes
  535.                         BananaCom disable many user functions so that those
  536.                         keystrokes may be passed through to the modem
  537.                         service - also, all cursor keys that were passed
  538.                         through as an escape sequence, are now passed
  539.                         through as a null sequence (see top of file for
  540.                         more info).
  541.  
  542.  
  543.   ESC [ i    not used - VT100 print stuff
  544.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  545.     not supported in BananaCom
  546.  
  547.  
  548.   ESC [ j    undefined
  549.   ESC [ k    undefined
  550.  
  551.  
  552.   ESC [ l    set options
  553.   ~~~~~~~~~~~~~~~~~~~~~~
  554.     These options include sending an actual question mark or equals sign as
  555.     part of the sequence.  They compliment the "ESC [ h" sequences.  Note
  556.     that these seqences end with a lowercase L:
  557.  
  558.        ESC [ ? 6 l      Negates "ESC [ ? 6 h".  This is the default.
  559.  
  560.        ESC [ ? 7 l      Auto word wrap is turned off.  Note that the next
  561.                         time you change the scrolling region, word wrap will
  562.                         be turned on again.
  563.  
  564.        ESC [ = 2 5 5 l  doorway mode off
  565.  
  566.  
  567.   ESC [ <num> ; <num> ; ... m    set video attributes
  568.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  569.     Set the foreground color, background color and blink attributes for
  570.     future text.  Note that each number may overwrite or enhance a previous
  571.     number.  There are four basic attributes:
  572.  
  573.          Foreground color:  8 colors
  574.  
  575.                    Bright:  On or off
  576.  
  577.          Background color:  8 colors
  578.  
  579.                  Blinking:  On or off
  580.                                                  Effects
  581.  
  582.     Possible numbers to pass:                  FC Br BC Bl
  583.  
  584.        0  "normal": gray on black, no blink     x  x  x  x
  585.        1  bright foreground                        x
  586.        2  regular (non-bright) foreground          x
  587.        4  underscore if available               x
  588.        5  Blink on                                       x
  589.        6  Blink on (yup, same as 5)                      x
  590.        7  reverse                               x     x
  591.        8  invisible text (fore=back)            x  x     x
  592.       30  black (+Br=dark gray)                 x
  593.       31  red (+Br=bright red)                  x
  594.       32  green (+Br=bright green)              x
  595.       33  brown (+Br=yellow)                    x
  596.       34  blue (+Br=bright blue)                x
  597.       35  magenta (+Br=bright magenta)          x
  598.       36  cyan (+Br=bright cyan)                x
  599.       37  gray (+Br=white)                      x
  600.       40  black                                       x
  601.       41  red                                         x
  602.       42  green                                       x
  603.       43  brown                                       x
  604.       44  blue                                        x
  605.       45  magenta                                     x
  606.       46  cyan                                        x
  607.       47  gray                                        x
  608.  
  609.     Examples:
  610.  
  611.       ESC [ 0 ; 1 ; 3 3 m        yellow on black with no blink
  612.  
  613.       ESC [ 3 3 m                use same background as before.
  614.                                  no change to blink attribute.
  615.                                  foreground is either brown or yellow
  616.                                  depending on the bright attribute.
  617.  
  618.       ESC [ m                    use "normal" attribute - gray on black,
  619.                                  no blink.
  620.  
  621.  
  622.   ESC [ 6 n    report current cursor location
  623.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  624.     If the cursor is located in the lower-right corner of the screen,
  625.     BananaCom will respond "ESC 2 4 ; 8 0 R".  Many modem services will
  626.     send "ESC [ 6 n" before asking a user what their name is.  When the
  627.     response is given, the modem service knows that the calling computer
  628.     supports ANSI terminal emulation.
  629.  
  630.  
  631.   ESC [ 2 5 5 n    report screen size
  632.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  633.     "ESC 2 4 ; 8 0 R" is always sent back.
  634.  
  635.  
  636.   ESC [ o    undefined
  637.  
  638.  
  639.   ESC [ p    not used - ANSI keyboard reassignment
  640.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  641.     not supported in BananaCom
  642.  
  643.  
  644.   ESC [ q    not used - VT100 keyboard lights
  645.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646.     has to do with turning the VT100 keyboard lights on and off.
  647.     not supported in BananaCom
  648.  
  649.  
  650.   ESC [ <top> ; <bottom> r    set scroll region
  651.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  652.     Define a region of the screen for scrolling.  This is usually used for
  653.     full screen text editors.  Some information can be stored on some parts
  654.     of the screen that will remain for the entire editing session - such as
  655.     what keys you push to indicate that you are done editing.  The scroll
  656.     region will be where the user types the text of their message.  Some
  657.     commands (escape sequences) always ignore the scrolling region; some
  658.     default to ignoring the scrolling region, but can work relative to the
  659.     scrolling region when the "ESC [ ? 6 h" sequence is sent; some always
  660.     work relative to the scrolling region if one is defined.
  661.  
  662.     Example:  ESC [ 2 ; 2 3 r    leave the first and last lines out of
  663.                                  the scrolling region.
  664.  
  665.     Example:  ESC [ 5 r          the first four lines are left out of the
  666.                                  scrolling region.
  667.  
  668.     Example:  ESC [ r            turn off scrolling region
  669.  
  670.  
  671.   ESC [ s    save current cursor position
  672.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  673.     The current cursor position is stored and can be reset with
  674.     "ESC [ u"
  675.  
  676.  
  677.   ESC [ t    undefined
  678.  
  679.  
  680.   ESC [ u    restore cursor position from last save
  681.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  682.     Restores the cursor position that was stored with "ESC [ s"
  683.  
  684.  
  685.   ESC [ v    undefined
  686.   ESC [ w    undefined
  687.   ESC [ x    undefined
  688.  
  689.  
  690.   ESC [ y    not used - VT100 tests
  691.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  692.     VT100 specs say that this is to invoke certain tests.
  693.     Not supported in BananaCom.
  694.  
  695.  
  696.   ESC [ z    not used - reset
  697.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  698.     some "ANSI" terminals use this to reset
  699.  
  700.  
  701.  
  702. The information in this document is for programmers writing all sorts of
  703. communications software - whether BBS's, door programs, or terminal
  704. emulation programs.  If you use this, I hope you mention "Banana ANSI" in
  705. your documentation.
  706.  
  707. The latest version of this document can be found on
  708.  
  709.          The Montana Banana BBS  (406)543-8234
  710.  
  711. Anyone having any information on VT100 class emulation or ANSI emulation
  712. that is not mentioned in this text file, I would appreciate a copy.
  713.  
  714.       Paul Wheaton
  715.       Banana Programming
  716.       1916 Brooks #205
  717.       Missoula, MT  59801
  718.  
  719.       CompuServe:  72707,207
  720.       Internet:  72707.207@compuserve.com
  721.  
  722. Resources:
  723.  
  724.   BBSAMT40.ZIP - ANSI Music Tutorial by Linda Bloom
  725.  
  726.   DRWY222.ZIP - Doorway by Marshall Dudley
  727.  
  728.   VT101 Video Terminal User Guide - part EK-VT101-UG-003 by Digital
  729.   Equipment Corporation.
  730.  
  731.   VT102 Video Terminal User Guide - part EK-VT102-UG-003 by Digital
  732.   Equipment Corporation.
  733.  
  734.   ANSI.X34 - ANSI X3.64 encodings as interpretted by a BYTE magazine
  735.   author, April 1984 page 365.
  736.  
  737. BananaCom Philosophy:
  738.  
  739.   Different modem services use different terminal emulations and different
  740.   "dialects" of terminal emulations.
  741.  
  742.   COM programs are trying to keep up by offering users dozens (hundreds,
  743.   sometimes infinite!) of configuration switches.  Users can pick which
  744.   emulation they want to use with each service and then create "dialects"
  745.   that will work best with that particular service.
  746.  
  747.   Now modem services are trying to expand their markets - trying to
  748.   include people that are uncomfortable with computers and especially
  749.   uncomfortable with modems.
  750.  
  751.   In an effort to help users get started with using their modem, and not be
  752.   intimidated by a plethora of options and features, BananaCom will have as
  753.   few features as possible while still giving users the functionality
  754.   necessary to cleanly accomplish simple tasks on VT100 and ANSI systems.
  755.  
  756.